-
Notifications
You must be signed in to change notification settings - Fork 0
[CLEAN] Synthetic Benchmark PR #138126 - Fix stats performance #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_138126_20251204_6245
Are you sure you want to change the base?
[CLEAN] Synthetic Benchmark PR #138126 - Fix stats performance #29
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
Benchmark PR elastic#138126
Type: Clean (correct implementation)
Original PR Title: Fix stats performance
Original PR Description: This fixes the N^2 performance problem described in elastic#97222. In addition to restoring the previous partial fix (elastic#130857), it does the following:
Closes elastic#97222
Original PR URL: elastic#138126
PR Type
Bug fix, Enhancement
Description
Fix N^2 performance problem in stats APIs by caching shared RAM calculations
Introduce CacheTotals record and refactor shared RAM distribution logic
Update IndicesQueryCache.getStats() to accept precomputed shared RAM supplier
Modify TransportIndicesStatsAction to use NodeContext for state sharing across shards
Update TransportClusterStatsAction to cache shared RAM calculations per node
Diagram Walkthrough
File Walkthrough
3 files
Refactor shared RAM calculation with CacheTotals recordUse NodeContext to cache query cache totals across shardsCache shared RAM calculations using CachedSupplier2 files
Accept precomputed shared RAM supplier in getShardLevelStatsPass precomputed shared RAM to indexShardStats method5 files
Update tests to use new getStats supplier parameterUpdate cache stats calls with precomputed shared RAMUpdate mocks to handle new indexShardStats signatureUpdate getShardLevelStats call with shared RAM supplierUpdate getShardLevelStats call with shared RAM supplier1 files
Add changelog entry for performance improvement